#include "DateTimeUtility.h"

namespace DateTimeUtility {

const std::string DATE_TIME_FOR_READ_FORMAT = "%Y-%m-%d %H:%M:%S";

const std::string DATE_TIME_FORMAT = "%Y%m%d%H%M%S";

const std::string YEAR_MOUTH_FORMAT = "%Y%m";

const std::string DATE_FORMAT = "%Y%m%d";




std::string& tmFormatToString(const std::tm& dateTime, const std::string& format, std::string& result) {

    const std::string::size_type length = result.length();
    std::string::size_type maxBufferSize = 128;
    result.resize(length + maxBufferSize);
    maxBufferSize = strftime(&result[length], maxBufferSize + 1, format.data(), &dateTime);
    result.resize(length + maxBufferSize);
    return result;
}

}
